<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ include file='../share_header.jsp' %>
<div id="content-header">
    <h1>密码修改</h1>
</div>
<%--<div id="breadcrumb">--%>
<%--&lt;%&ndash;<a href="index.html" class="tip-bottom" data-original-title="Go to Home"><i class="icon-home"></i> Home</a>&ndash;%&gt;--%>
<%--<a href="javascript:void(0)"--%>
<%--url="${pageContext.request.contextPath}/crm/getMyselfClientInfo.do"  class="m-pageChange tip-bottom">系统管理</a>--%>
<%--<a href="#" class="current">密码修改</a>--%>
<%--</div>--%>
<div class="container-fluid marginTop20">
    <div class="widget-box">
        <div class="widget-content nopadding">
            <form class="form-horizontal" method="post" action="#" name="password_validate" id="password_validate"
                  novalidate="novalidate">

                <div class="control-group">
                    <label class="control-label">输入原密码</label>

                    <div class="controls">
                        <input type="password" name="oldPwd" id="oldPwd">
                        <%--<span for="oldPwd" generated="true" class="help-inline">Please enter at least 6 characters.</span>--%>
                    </div>
                </div>

                <div class="control-group">
                    <label class="control-label">输入新密码</label>

                    <div class="controls">
                        <input type="password" name="newPwd" id="newPwd">
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">再次输入新密码</label>

                    <div class="controls">
                        <input type="password" name="newPwd2" id="newPwd2">
                    </div>
                </div>
                <div class="form-actions">
                    <input type="submit" value="提交" class="btn btn-primary">
                </div>
            </form>
        </div>
    </div>
</div>
<script>
    $(function () {
        $("#password_validate").validate({
            errorElement: 'div',
            errorClass: 'help-inline',
            focusInvalid: false,
            rules: {
                oldPwd: {
                    required: true
                },
                newPwd: {
                    required: true
                },
                newPwd2: {
                    required: true,
                    equalTo: "#newPwd"
                }
            },
            messages: {
                oldPwd: {
                    required: "输入原密码不能为空！"
                },
                newPwd: {
                    required: "输入新密码不能为空！"
                },
                newPwd2: {
                    required: "再次输入新密码不能为空！",
                    equalTo: "两次密码输入不一致！"
                }
            },
            highlight: function (element) {
                $(element).closest('.control-group').addClass('error');
            },
            success: function (label) {
                label.closest('.control-group').removeClass('error');
                label.remove();
            },
            errorPlacement: function (error, element) {
                element.parent('.controls').append(error);
            }

        });

        $('#password_validate').submit(function () {
            if ($("#password_validate").valid()) {
                var url = "";
                var postData = {};
                postAjax(url, postData, function () {
                });
            }
        });
    })
</script>
